package com.ruicar.afs.cloud.channel.online.feign;

import com.ruicar.afs.cloud.common.core.feign.annotations.AfsFeignClear;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import com.ruicar.afs.cloud.common.modules.dto.mq.voucher.VoucherFlowInfoDto;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

/**
 * @author infinity
 * @version 1.0
 * @description: 对接凭证服务，保存流水信息
 * @date 2020/7/2 9:54
 */
@FeignClient(name = "voucherInfo", url = "${com.greatwall.services.voucher-service.url}")
public interface VoucherFlowApiFeign {
    /**
     * @param dto
     * @return
     */
    @ApiOperation("发送凭证流水API接口")
    @PostMapping(value = "/save")
    @AfsFeignClear(true)
    //通过此注解防止添加内部token
    IResponse<Boolean> send(@RequestBody @Validated VoucherFlowInfoDto dto, @RequestHeader Map<String, String> headers);

}
